﻿
function reloadGrid() {
    $('#tSortable').dataTable({
        "iDisplayLength": 5,
        "aLengthMenu": [5, 10, 25, 50, 100],
        "sPaginationType": "full_numbers",
        "iSortingCols": "STT"
    });
}


function Success(data) {
    if (data != "") {
        $.topAlertPopup({ "text": "Update completed", "typeAlert": "success" });
        $('#ID').val(data.ID);
        $('#Name').val(data.Name);
        $('#Note').val(data.Note);
        $('#ManufacturerID').val(data.ManufacturerID);
        if (data.Active == false) {
            $('input[id=Active]').attr('checked', false);
        }
        else {
            $('input[id=Active]').attr('checked', true);
        }
        $('#Link').val(data.Link);
        $('#MetaTitle').val(data.MetaTitle);
        $('#MetaKeyword').val(data.MetaKeyword);
        $('#MetaDescription').val(data.MetaDescription);
    }
    else {
        $.topAlertPopup({ "text": "Error, try again please !", "typeAlert": "error" });
    }
}


       
